package data;

import com.EntityName;
import com.google.appengine.api.datastore.Entity;

public class POSZone extends AbstractData {
	private long id;
	private long hotelId;
	private long POSId;
	private String title;
	private boolean status;
	private boolean avaliable;
	
	
	public POSZone() {
		status = true;
		avaliable = true;
	}

	public POSZone(long id) {
		this.id = id;
		this.status = true;
		this.avaliable = true;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public long getHotelId() {
		return hotelId;
	}
	public void setHotelId(long hotelId) {
		this.hotelId = hotelId;
	}
	public long getPOSId() {
		return POSId;
	}

	public void setPOSId(long pOSId) {
		POSId = pOSId;
	}

	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public boolean isStatus() {
		return status;
	}
	public void setStatus(boolean status) {
		this.status = status;
	}
	public boolean isAvaliable() {
		return avaliable;
	}
	public void setAvaliable(boolean avaliable) {
		this.avaliable = avaliable;
	}
	
	
	@Override
	public Entity getEntity() {
		Entity item;
		if(this.key == null)
			item = new Entity(EntityName.POSZone);
		else
		item = new Entity(this.key);
		item.setProperty("POSId", this.POSId);
		item.setProperty("title", this.title);
		item.setProperty("hotelId", this.hotelId);
		item.setProperty("status", this.status);
		item.setProperty("avaliable", this.avaliable);
		return item;
	}
	@Override
	public void setEntity(Entity entity) {
		this.id = entity.getKey().getId();
		this.POSId=(Long)entity.getProperty("POSId");
		this.title=(String)entity.getProperty("title");
		this.hotelId = (Long) entity.getProperty("hotelId");
		this.avaliable = (Boolean) entity.getProperty("avaliable");
		this.status = (Boolean) entity.getProperty("status");
		this.key = entity.getKey();
		
	}
	public void LoadData() {
		if (this.id > -1) {
			Entity entity = LoadData(EntityName.POSZone, this.id);
			setEntity(entity);
		}
	}
}
